<template>
  <div class="box">
      <MyMtHeader titleText="会员设置" />
      <div class="main">
            <div class="item-top">
                <mt-cell title="完善基本信息"></mt-cell>
                <mt-field label="昵称"  v-model="userInfo.username"></mt-field>
                <mt-field label="邮箱" placeholder="请输入邮箱" type="email" v-model="userInfo.email"></mt-field>
            </div>
            <button class="item-btn">修改用户信息</button>
            <div class="item-bottom">
                <mt-cell title="密码修改"></mt-cell>
                <mt-field label="原始密码" placeholder="请输入密码" type="text" v-model="userInfo.pass"></mt-field>
                <mt-field label="新密码" placeholder="请输入密码" type="password" v-model="userInfo.newPass"></mt-field>
                <mt-field label="确认密码" placeholder="请输入密码" type="password" v-model="userInfo.confirmPass"></mt-field>
            </div>
            <button @click="changePass" class="item-btn">修改密码</button>
      </div>
  </div>
</template>

<script>
import {Toast} from 'mint-ui'
import MyMtHeader from '../MyMtHeader/MyMtHeader.vue'
export default {
    components: { MyMtHeader },
    data(){
        return {
            userInfo:{
                username:15976912781,
                email:'',
                pass:'',
                newPass:'',
                confirmPass:''
            }
        }
    },
    methods:{
        changePass(){
            let {pass,newPass,confirmPass} = this.userInfo
            if ( newPass !== confirmPass){
                Toast('两次密码不一致')
            }
        }
    }
}
</script>

<style scoped>
.box{
    min-height: 100vh;
    background: #e7e8e861;
}
.item-top{
    margin-top: 20px;
}
.item-btn{
    margin: 20px 0px;
    width: 100%;
    height: 40px;
    color: #26a2ff;
    line-height: 40px;
    border-radius: 5px;
    border: 1px solid #26a2ff;
}
</style>